<?php

namespace app\validate\admin;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Store extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        'store_name|门店名称' => 'require|min:5|unique:store',
        'store_cover|门店封面' => 'require',
        'phone|联系方式' => 'require|mobile',
        'address|地址' => 'require|min:6',
        'sort|排序' => 'require',
        'start_time|开始时间' => 'require',
        'end_time|结束时间' => 'require',
        'morning_start|早班开始时间' => 'require',
        'morning_end|早班结束时间' => 'require',
        'middle_start|中班开始时间' => 'require',
        'middle_end|中班结束时间' => 'require',
        'evening_start|晚班开始时间' => 'require',
        'evening_end|晚班结束时间' => 'require',
    ];
    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'create' => ['store_name', 'store_cover', 'phone', 'address', 'sort', 'start_time', 'end_time', 'morning_start',
            'morning_end', 'middle_start', 'middle_end', 'evening_start', 'evening_end'],
        'update' => ['store_name', 'store_cover', 'phone', 'address', 'sort', 'start_time', 'end_time', 'morning_start',
            'morning_end', 'middle_start', 'middle_end', 'evening_start', 'evening_end'],
    ];

}
